package kr.re.etri.snsenabler.server.api;

import org.scribe.builder.api.DefaultApi10a;
import org.scribe.model.Token;

public class NaverApi extends DefaultApi10a {
	private static final String AUTHORIZE_URL = "https://nid.naver.com/naver.oauth?mode=auth_req_token&oauth_token=%s";
	private static final String REQUEST_TOKEN_RESOURCE = "https://nid.naver.com/naver.oauth?mode=req_req_token";
	private static final String ACCESS_TOKEN_RESOURCE = "https://nid.naver.com/naver.oauth?mode=req_acc_token";

	@Override
	public String getAccessTokenEndpoint() {
		return ACCESS_TOKEN_RESOURCE;
	}

	@Override
	public String getRequestTokenEndpoint() {
		return REQUEST_TOKEN_RESOURCE;
	}

	@Override
	public String getAuthorizationUrl(Token requestToken) {
		return String.format(AUTHORIZE_URL, requestToken.getToken());
	}
}
